furny.ga.rules
Class MaxDistanceToWallRule
java.lang.Object
furny.ga.rules.MaxDistanceToWallRule
- All Implemented Interfaces:
- IValidationRule<FurnLayoutIndividual>
public class MaxDistanceToWallRule
- extends java.lang.Object
- implements IValidationRule<FurnLayoutIndividual>
This is a IValidationRule
implementation that keeps furnitures at a
wall.
- Since:
- 12.08.2012
- Author:
- Stephan Dreyer
Constructor Summary |
MaxDistanceToWallRule(float maxDistance)
Creates the rule with a maximum distance. |
MaxDistanceToWallRule(java.lang.String tagName,
float maxDistance)
Creates the rule for a given tag name and a maximum distance. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOGGER
private static final java.util.logging.Logger LOGGER
maxAllowedDistance
private float maxAllowedDistance
tag
private final Tag tag
MaxDistanceToWallRule
public MaxDistanceToWallRule(java.lang.String tagName,
float maxDistance)
- Creates the rule for a given tag name and a maximum distance.
- Parameters:
tagName
- The tag name.maxDistance
- The maximum distance.- Since:
- 12.08.2012
MaxDistanceToWallRule
public MaxDistanceToWallRule(float maxDistance)
- Creates the rule with a maximum distance. The tag name will be
"Location/Wall".
- Parameters:
maxDistance
- The maximum distance.- Since:
- 12.08.2012
matchingDegree
public float matchingDegree(FurnLayoutIndividual individual,
GAContext context)
- Description copied from interface:
IValidationRule
- Calculates the matching degree in [0;1] for this rule. If the given
individual does not match the rule, 0 will be returned.
- Specified by:
matchingDegree
in interface IValidationRule<FurnLayoutIndividual>
- Parameters:
individual
- The individual to test.context
- The GA context.
- Returns:
- The matching degree between 0 and 1.
getType
public IValidationRule.Type getType()
- Description copied from interface:
IValidationRule
- Getter for the type of this rule.
- Specified by:
getType
in interface IValidationRule<FurnLayoutIndividual>
- Returns:
- The type.